﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admins/Administrator.Master" AutoEventWireup="true"
    CodeBehind="Advertise.aspx.cs" Inherits="MyWeb.Admins.Advertise" %>

<%@ Register Src="../Module/uploader.ascx" TagName="uploader" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="title">
        Quản trị Advertise</div>
    <asp:Panel ID="pnShow" runat="server" Width="100%">
        <table id="Table1" style="border-collapse: collapse; background-color: #D0DEF0;"
            cellpadding="0" width="100%" border="0">
            <tr>
                <td>
                    <asp:Button ID="btnThem" runat="server" CssClass="btnthem" Text="Thêm mới" OnClick="btnThem_Click" />
                </td>
            </tr>
        </table>
        <asp:DataGrid ID="grdAdvertise" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CellPadding="3" ForeColor="Black" Width="100%" 
            OnPageIndexChanged="grdAdvertise_PageIndexChanged" 
            OnItemCommand="grdAdvertise_ItemCommand" 
            OnItemDataBound="grdAdvertise_ItemDataBound" BackColor="White" 
            BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
            GridLines="Vertical">
            <AlternatingItemStyle BackColor="#CCCCCC" />
            <HeaderStyle CssClass="trHeader" BackColor="Black"></HeaderStyle>
            <Columns>
                <asp:BoundColumn DataField="Id" HeaderText="Id"></asp:BoundColumn>
                <asp:BoundColumn DataField="Name" HeaderText="Name"></asp:BoundColumn>
                <asp:BoundColumn DataField="Url" HeaderText="Url"></asp:BoundColumn>
                <asp:BoundColumn DataField="Link" HeaderText="Link"></asp:BoundColumn>
                <asp:BoundColumn DataField="Target" HeaderText="Target"></asp:BoundColumn>
                <asp:BoundColumn DataField="Position" HeaderText="Position"></asp:BoundColumn>
                <asp:BoundColumn DataField="Order" HeaderText="Order"></asp:BoundColumn>
                <asp:BoundColumn DataField="Status" HeaderText="Status"></asp:BoundColumn>
                <asp:TemplateColumn>
                    <HeaderTemplate>
                        Chức Năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lbt1" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id") %>'
                            CommandName="Edit" CssClass="edit" ToolTip="Sửa" />
                        <asp:LinkButton runat="server" ID="lbt2" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id") %>'
                            CommandName="Delete" CssClass="delete" ToolTip="Xoá" OnClientClick="return confir(Bạn có chắc chắn không ?)" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedItemStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        </asp:DataGrid>
    </asp:Panel>
    <asp:Panel ID="pnUpdate" runat="server" Visible="False" Width="100%">
        <table id="Table2" style="border-collapse: collapse" cellpadding="0" width="100%"
            border="0">
            <tr>
                <td width="150" height="10">
                </td>
                <td height="10">
                </td>
            </tr>
            <caption>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;
                        <asp:Label ID="Label1" Visible="true" runat="server">Id</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtId" runat="server" Visible="true" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;
                        <asp:Label ID="lblName" runat="server">Name</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;
                        <asp:Label ID="lblUrl" runat="server">Url</asp:Label>
                    </td>
                    <td>
                        <uc1:uploader ID="uploader1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;
                        <asp:Label ID="lblWidth" runat="server">Width</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtWidth" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;<asp:Label ID="lblHeight" runat="server">Height</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtHeight" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;<asp:Label ID="lblLink" runat="server">Link</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtLink" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;<asp:Label ID="lblTarget" runat="server">Target</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtTarget" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;<asp:Label ID="lblPosition" runat="server">Position</asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlPosition" runat="server">
                            <asp:ListItem Value="0">Banner</asp:ListItem>
                            <asp:ListItem Value="1">Flash</asp:ListItem>
                            <asp:ListItem Value="2">SlideBar-left</asp:ListItem>
                            <asp:ListItem Value="3">SlideBar-right</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="name_fild_row" width="150">
                        &nbsp;<asp:Label ID="lblOrder" runat="server">Order</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtOrder" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td width="150" class="name_fild_row">
                        <asp:Label ID="Label4" Text="Trạng Thái" runat="server" />
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlStatus" runat="server">
                            <asp:ListItem Value="1">Sử Dụng</asp:ListItem>
                            <asp:ListItem Value="2">Cấm Sử Dụng</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td width="150">
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;<asp:LinkButton ID="lbtUpdate" runat="server" CssClass="update" OnClick="lblUpdate_Click">Cập nhật</asp:LinkButton>
                        &nbsp;&nbsp;<asp:LinkButton ID="lblBack" runat="server" CssClass="back" OnClick="lblBack_Click">Trở lại</asp:LinkButton>
                    </td>
                </tr>
            </caption>
        </table>
    </asp:Panel>
</asp:Content>
